/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-19
 * 21:53
 */
public class Test {
    public static void eat (Animal animal){
        animal.eat();
    }
    public static void sleep (Animal animal){
        animal.sleep();
    }
    public static void main(String[] args) {
        Cat cat = new Cat("小猫", 3);
        Dog dog = new Dog("小狗", 4);

        eat(cat);
        eat(dog);
        sleep(cat);
        sleep(dog);
    }
}
